home *** CD-ROM | disk | FTP | other *** search
/ Canadian Geographic Explorer / Canadian Geographic Explorer.iso / pc / riddler.dxr / 00026_Anim Object Script.ls < prev    next >
Encoding:
Text File  |  1996-10-03  |  866 b   |  32 lines

  1. property mySprite, myFirstFrame, myNumOfFrames, myLoc, myLooping, myFrame
  2.  
  3. on new me, pSprite
  4.   set mySprite to pSprite
  5.   return me
  6. end
  7.  
  8. on init me, pFirstFrame, pNumOfFrames, pLoc, pLooping
  9.   set myFirstFrame to pFirstFrame
  10.   set myNumOfFrames to pNumOfFrames
  11.   set myLoc to pLoc
  12.   set myLooping to pLooping
  13.   set myFrame to 0
  14.   if not (the puppet of sprite mySprite) then
  15.     puppetSprite(mySprite, 1)
  16.   end if
  17.   set the castNum of sprite mySprite to myFirstFrame
  18.   set the loc of sprite mySprite to myLoc
  19.   updateStage()
  20. end
  21.  
  22. on stepFrame
  23.   if myLooping or (not myLooping and (myFrame < (myNumOfFrames - 1))) then
  24.     set myFrame to (myFrame + 1) mod myNumOfFrames
  25.   end if
  26.   if not (the puppet of sprite mySprite) then
  27.     puppetSprite(mySprite, 1)
  28.   end if
  29.   set the castNum of sprite mySprite to the number of member myFirstFrame + myFrame
  30.   updateStage()
  31. end
  32.